{#
Copyright 2017 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#}

resources:
- name: soccer-{{ properties["zone"] }}
  type: container.v1.cluster
  properties:
    zone: {{ properties["zone"] }}
    cluster:
      name: soccer-{{ properties["zone"] }}
      description: side server cluster for soccer multiplayer, in zone {{ properties["zone"] }}
      nodePools:
        - name: "apps"
          initialNodeCount: 3
          config:
            machineType: n1-standard-1
            labels:
              role: apps
            oauthScopes:
              - https://www.googleapis.com/auth/devstorage.read_only
              - https://www.googleapis.com/auth/compute
              - https://www.googleapis.com/auth/cloud-platform
        - name: "game-servers"
          initialNodeCount: 2
          config:
            machineType: n1-standard-4
            tags:
              - game-server
            labels:
              role: game-server
            oauthScopes:
              - https://www.googleapis.com/auth/devstorage.read_only
      masterAuth:
        username: admin
        password: supersecret
- name: game-server-firewall
  type: compute.v1.firewall
  properties:
    name: game-server
    targetTags:
      - "game-server"
    allowed:
      - IPProtocol: udp
        ports:
          - "7000-8000"
